package org.gd.hellojaxb.privat24.regular;

import org.gd.hellojaxb.adapters.DateAdaptersFactory;
import org.gd.hellojaxb.adapters.DoubleAdaptersFactory;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;

@XmlRootElement(name = "request")
@XmlAccessorType(XmlAccessType.FIELD)
public class EditRegularPayRequest {

    @XmlRootElement(name = "id")
    @XmlAccessorType(XmlAccessType.FIELD)
    @SuppressWarnings({"unused"})
    public static final class Request {
        /** bank */
        @XmlAttribute(name = "Bank")
        private RegularPayBank bank;
        /** ид регулярного платежа */
        @XmlAttribute(name = "Id")
        private Long id;
        /** день списания рег. Платежа */
        @XmlAttribute(name = "nrPeriod")
        private Integer period;
        /** тип списания(A,D,W,M) */
        @XmlAttribute(name = "nrPeriodType")
        private String periodType;
        /** сумма */
        @XmlAttribute(name = "nrAmount")
        @XmlJavaTypeAdapter(DoubleAdaptersFactory.Amount.class)
        private Double amount;
        /** назначение платежа */
        @XmlAttribute(name = "nrPaymPurpose")
        private String purpose;
        /** дата окончания ('2012.10.05') */
        @XmlJavaTypeAdapter(DateAdaptersFactory.EditRegularPayDateFormat.class)
        @XmlAttribute(name = "nrDfinish")
        private Date dateFinish;//=
        /** лдап операциониста */
        @XmlAttribute(name = "OperLdap")
        private String ldap;
        /** ip адресс операционниста */
        @XmlAttribute(name = "OperIp")
        private String ip;

        public Request() {
        }

        public RegularPayBank getBank() {
            return bank;
        }

        public Request setBank(RegularPayBank bank) {
            this.bank = bank;
            return this;
        }

        public Long getId() {
            return id;
        }

        public Request setId(Long id) {
            this.id = id;
            return this;
        }

        public Integer getPeriod() {
            return period;
        }

        public Request setPeriod(Integer period) {
            this.period = period;
            return this;
        }

        public String getPeriodType() {
            return periodType;
        }

        public Request setPeriodType(String periodType) {
            this.periodType = periodType;
            return this;
        }

        public Double getAmount() {
            return amount;
        }

        public Request setAmount(Double amount) {
            this.amount = amount;
            return this;
        }

        public String getPurpose() {
            return purpose;
        }

        public Request setPurpose(String purpose) {
            this.purpose = purpose;
            return this;
        }

        public Date getDateFinish() {
            return dateFinish;
        }

        public Request setDateFinish(Date dateFinish) {
            this.dateFinish = dateFinish;
            return this;
        }

        public String getLdap() {
            return ldap;
        }

        public Request setLdap(String ldap) {
            this.ldap = ldap;
            return this;
        }

        public String getIp() {
            return ip;
        }

        public Request setIp(String ip) {
            this.ip = ip;
            return this;
        }
    }

    @XmlElement(name = "id")
    private Request request;

    public EditRegularPayRequest() {
        request = new Request();
    }

    public Request getRequest() {
        return request;
    }
}
